import { createBrowserRouter as Router } from "react-router-dom"
import App from "../App"
import Layout from "../component/layout/Layouta"
import Dynamic_Content from "../component/layout/Dynamic_Content"
import Contenta from "../component/layout/Contenta"
import Home from "../component/normal/Home"
import List from "../component/normal/List"
// 路由首位告阶组件
let Auoth = (Component) => {
    if (localStorage.getItem("RefreshToken")) {
        return Component
    } else {
        return <Home />
    }
}

let router = Router([
    {
        path: "/",
        element: <App />,
        children: [
            {
                path: "/Layout",
                element: <Layout />,
                children: [
                    {
                        path: "/Layout/Dynamic_Content",
                        element: <Dynamic_Content />
                    },
                    {
                        path: "/Layout/Contenta",
                        element: <Contenta />
                    }
                    // {
                    //     path: "/Layout/About",
                    //     element: <About />
                    // }
                ]
            },
            {
                path: "/home",
                element: <Home />
            },
            {
                path: "/list",
                element:<List></List>
            }
        ]
    }
])
export default router